package com.gao.api.gate.quick.proto.filter;

import com.gao.api.gate.quick.proto.http.HttpRequest;
import com.gao.api.gate.quick.proto.http.HttpRequestBody;
import com.gao.api.gate.quick.proto.http.HttpRequestContext;
import com.gao.api.gate.quick.proto.http.HttpResponse;

/**
 * <p></p>
 *
 * @author gaoshuangwen
 * @since 2022/01/09 21:56
 */
public abstract class RouteFilter extends AbstractFilter{

    public RouteFilter() {
        super(FilterType.route);
    }

    @Override
    public void doFilter(HttpRequestContext context) throws FilterException {

        HttpResponse resp = route(context.getRequest());
        context.setResponse(resp);

    }
    public abstract HttpResponse route(HttpRequest httpRequest);


}
